// ==UserScript==
// @name         boss提醒器
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.zhipin.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nowcoder.com
// @grant        none
// ==/UserScript==
// @require      https://code.jquery.com/jquery-1.11.3.min.js
(function() {
    'use strict';
    let mark=2;
    var clock ='';
    clock = setInterval(countDown, 1000); //1秒钟执行一次
    function countDown(){
       mark--;
       if(mark > 0){
           var idName = $('.nav-chat-num');
           if(idName.text()>=0){
               var userList = $('.user-list').children('ul');
               if(userList && userList[0]){
                   var users = $(userList[0]).children('li');
                   if(users){
                       for(var i=0;i<users.length;i++){
                           //开始得到公司
                           var company = $(users[i]).children('div');
                           var cName = $(company[1]).children('div');
                           var cNameHRName = $(cName).children('p')
                           cNameHRName= $(cNameHRName).text().split(' ');
                           var companyName = cNameHRName[1];
                           var hrPosition = cNameHRName[3];
                           console.log(cName)
                           console.log(companyName+","+hrPosition)
                       }
                   }
               }else{
                  //直接发送邮件
               }
           }
       }else{
           clearInterval(clock); //清除js定时器
       }
   }
   //键盘事件结束
})();
